<!DOCTYPE html>
<html>
<head>

<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script src="${request.getContextPath()}/themes/admin/js/jquery.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${webroot}/plugins/tree/js/jquery.ztree.all-3.5.min.js"></script>
<script
	src="${request.getContextPath()}/plugins/timepicker/WdatePicker.js"
	type="text/javascript"></script>
<script src="${request.getContextPath()}/themes/admin/js/ajax.js"
	type="text/javascript"></script>
<script src="${request.getContextPath()}/themes/admin/js/admin.js"
	type="text/javascript"></script>
<script src="${request.getContextPath()}/themes/admin/js/base.js"
	type="text/javascript"></script>
<script src="${request.getContextPath()}/themes/admin/js/adminBasis.js"
	type="text/javascript"></script>
<script src="${request.getContextPath()}/themes/admin/js/area.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/themes/admin/js/jquery.cookie.js"
	type="text/javascript"></script>
</head>
<body class="full">
	<div id="main" class="clearfix">
		<div class="module_add">
			<h3 class="view_h2">银行卡信息：</h3>
		</div>
		<div class="module_border">
			<div class="s">真实姓名:</div>
			<div class="h"><#if
				bankCardInfo.user??>${bankCardInfo.user.realName!"-"}</#if></div>
			<div class="s">银行卡号:</div>
			<div class="h"><#if
				bankCardInfo??>${bankCardInfo.cardNo!"-"}</#if></div>
			<div class="s">添加时间:</div>
			<div class="h"><#if
				bankCardInfo??>${bankCardInfo.addTime!"-"}</#if></div>
			<div class="s">
				<#if (borrowTenderList?size>0)> 更换:<input type="checkbox"
					value=${bankCardInfo.id?c} id="changeId" /> </#if>
			</div>

		</div>

		<div class="module_add">
			<h3 class="view_h2">回款记录</h3>
		</div>
		<div class="module_border">
			<#if borrowTenderList??>
			<table class="data-list">

				<tr class="header">
					<td>用户姓名</td>
					<td>回款银行卡</td>
					<td>回款银行卡卡号</td>
					<td>申购时间</td>
					<td>回款时间</td>
				</tr>
				<#list borrowTenderList as obj>
				<tr>
					<td>${obj.user.realName!"-"}</td>
					<td>${obj.bankCard.bankShortName!"-"}</td>
					<td>${obj.bankCard.cardNo!"-"}</td>
					<td>${obj.addtime!"-"}</td> <#list obj.borrowCollections as b> <#if
					b_index == 0>
					<td>${b.repayTime!"-"}</td> </#if> </#list>
				</tr>
				</#list>
			</table>
			<#else>暂无</#if>
		</div>
		<br /> <br /> <br /> <br />
		<div class="other">
			<input id="submitBtn" type="submit" name="reset" value="更换回款银行卡"
				class="input-button confirm" />
		</div>
	</div>
</body>

<script type="text/javascript">
	$("#submitBtn")
			.click(
					function() {
						if ($("#changeId").attr("checked")) {
							var cardId = $("#changeId").val();
							$
									.ajax({
										type : "post",
										url : "/admin/bankcard/changeBankcard.html",
										data : {
											"bankCardId" : cardId
										},
										success : function(data) {
											if (data.resultCode == 1) {
												alert("更换成功");
												location.href = "/admin/bankcard/bankcardInfoList.html?search=true&userName=${search_userName}&phone=${search_phone}&cardId=${search_cardId}&bankCardNo=${search_bankCardNo}";
											} else if (data.resultCode == 0
													&& data.resultMsg) {
												fnShowReturn(
														$("input[id='submitBtn']"),
														data.resultMsg);
											} else {
												fnShowReturn(
														$("input[id='submitBtn']"),
														"非法操作！如有疑问，请联系管理员！");
											}
										}
									});
						} else {
							alert("请勾选要更换的银行卡");
						}
					});

	function fnShowReturn(obj, html) {
		$("#returnInfo").remove();
		obj.before('<span class="return_info" id="returnInfo">' + html
				+ '</span>');
	}
</script>
</html>





